import {generatorServer} from '../../tools/servers'

debugger;
/**
 * 代码生成
 */
export class GeneratorService {
  // 生成模型
  static generateModel (modelDefinition) {
    var body = generatorServer.getArgs(this.generateModel,arguments,'GET');
    return generatorServer.connection('GET', 'generator/generateModel', body);
  }
  // 生成基础代码
  static generateBaseCode (className) {
    var body = generatorServer.getArgs(this.generateBaseCode,arguments,'GET');
    return generatorServer.connection('GET', 'generator/generateBaseCode', body);
  }
  //生成方法代码
  static generateMethod (controllerMethodName) {
    var body = generatorServer.getArgs(this.generateMethod,arguments,'GET');
    return generatorServer.connection('GET', 'generator/generateMethod', body);
  }

  //生成方法代码
  static createSuperOperator() {
    var body = generatorServer.getArgs(this.createSuperOperator,arguments,'GET');
    return generatorServer.connection('GET', 'generator/createSuperOperator', body);
  }

  //异常测试
  static testException() {
    var body = generatorServer.getArgs(this.testException,arguments,'GET');
    return generatorServer.connection('GET', 'generator/testException', body);
  }

}
